﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/BMP_EditII.master" AutoEventWireup="true" responseEncoding="utf-8"
    CodeFile="Edit.aspx.cs" Inherits="Pages_MdLongLa_Edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" runat="Server">   
        <table class="editTable" id="editTable" cellpadding="0" cellspacing="0">
        <tr>
         <th>
                市(<label style="color: Red">*</label>)
            </th>
            <td>
                

                    <select name="province" id="province" style="display: none" >
                    </select>
                    <select name="city" id="city" opt="%" field="Equip_City" onchange="SetPC('city');" style="width:100px;">
                    </select>
                    <input id="MdLongLaInfo_City" type="text" des="市" emp="true" runat="server"
                    clientidmode="Static" style="display:none;" />
           </td>
           
               <th>
                县（区）(<label style="color: Red">*</label>)
            </th>
            <td>  
          <select name="district" id="district" opt="%" field="Equit_Country" onchange="SetPC('district');" style="width:100px;margin-right:5px;">
          </select>
          <input id="MdLongLaInfo_County" type="text" des="县（区）" emp="true" runat="server" style="display:none;"
                    clientidmode="Static" />
            </td>
        </tr>
        <tr>
           
            <th>
                村（街道、单位）(<label style="color: Red">*</label>)
            </th>
            <td>
                <input id="MdLongLaInfo_NAME" type="text" des="村（街道、单位）" emp="true"
                    runat="server" clientidmode="Static" />
            </td>
        
	
		<th>经度</th><td><input  id="MdLongLaInfo_Longitude" type="text" des="经度" exp="reg_Decimal" runat="server" clientidmode="Static"/></td>		
			<th>纬度</th><td><input  id="MdLongLaInfo_Latitude" type="text" des="纬度" exp="reg_Decimal" runat="server" clientidmode="Static"/></td>		
			
		</tr>
			
        </table>   

        
     <script type="text/javascript" src="<%= ZPath.ResourcesURI %>Scripts/jQuery/jquery.js"></script>
    <script type="text/javascript" src="<%= ZPath.ResourcesURI %>Scripts/CitySelect.js"></script>
    <script type="text/javascript">
        //省市区联动
        if (CitySel != undefined) {
            CitySel.init('province', 'city', 'district');
        }
        //初始化
        CitySel.loadC();
        CitySel._ed.html('');
        jsSelectItemByValue(document.getElementById('city'), document.getElementById('MdLongLaInfo_City').value);

        CitySel.loadD();
        jsSelectItemByValue(document.getElementById('district'), document.getElementById('MdLongLaInfo_County').value);



        //设置省市区值
        function SetPC(change) {
            //alert(value);
            //tc:txt
            var tc = document.getElementById('MdLongLaInfo_City');
            var td = document.getElementById('MdLongLaInfo_County');
            var sc = document.getElementById('city');
            var sd = document.getElementById('district');
            var scText = "";
            var sdText = "";
            if (change == "city") {
                //选中的市，初始化市、区
                tc.value = "";
                td.value = "";
                if (sc != undefined && sc.selectedIndex != -1) {
                    scText = sc.options[sc.selectedIndex].text;
                    if (scText != undefined && scText != '===市===') {
                        tc.value = scText;
                    }
                }
            }

            if (change == "district") {
                td.value = "";
                if (sd != undefined && sd.selectedIndex != -1) {
                    sdText = sd.options[sd.selectedIndex].text;
                    if (sdText != undefined && sdText != '===区===') {
                        td.value = sdText;
                    }
                }
            }
        }

        //设置select中text="paraText"的第一个Item为选中 
        function jsSelectItemByValue(objSelect, objItemText) {
            for (var i = 0; i < objSelect.options.length; i++) {
                if (objSelect.options[i].text == objItemText) {
                    objSelect.options[i].selected = true;
                    break;
                }
            }
        }
    

    </script>

</asp:Content>
